package com.angel.bo.common.util;


import com.angel.bo.common.constant.ReturnCode;
import com.angel.bo.common.msg.WebReturn;

/**
 * @Author: Haibo.Mei [Haibo.Mei@ge.com]
 * @Description: 判断返回结果工具类
 * @Date: 11:25 2017/12/8
 */
public class ResultCheckUtil {

    public static boolean resultIsOk(WebReturn response) {

        //首先判断结果是否正确
        if (!ReturnCode.OK.equals(response.getStatus())) {
            return false;
        }

        return true;
    }

    public static boolean resultHasData(WebReturn response) {
        //首先判断结果是否正确
        if (!ReturnCode.OK.equals(response.getStatus())) {
            return false;
        }

        if (null == response.getData()) {
            return false;
        }
        return true;
    }

}
